package collection;

import java.util.Arrays;
import java.util.List;

/**
 * 数组转集合
 */
public class ArrayToListDemo {
    public static void main(String[] args) {
        String[] arr={"1","2","3","4","5"};
        String arrs=Arrays.toString(arr);
        System.out.println(arrs);
        List<String> list=Arrays.asList(arr);
        System.out.println(list);
        arr[1]="6";
        System.out.println("The array:"+Arrays.toString(arr));
        System.out.println("The list:"+list);
        list.set(1,"7");
        System.out.println("The array:"+Arrays.toString(arr));
        System.out.println("The list:"+list);
    }
}
